﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccess.Object;
using System.Data.SqlClient;
using System.Data;

namespace DataAccess
{
    public class BaoCaoDAO
    {
        private DataAccess _conn;
        public BaoCaoDAO()
        {
            _conn = new DataAccess();
        }

        public DataTable baoCaoTheoNgay(string query)
        {
            SqlParameter[] param = new SqlParameter[1];

            param[0] = new SqlParameter("@P_STR", SqlDbType.NVarChar);
            param[0].Value = query;

            return _conn.ExecuteDataTable("REPORT_THEO_NGAY",param);
        }

        public DataTable kieuChuyenPhat(string likeStr)
        {
            SqlParameter[] param = new SqlParameter[1];


            param[0] = new SqlParameter("@P_STR", SqlDbType.NVarChar);
            param[0].Value = likeStr;

            return _conn.ExecuteDataTable("REPORT_KIEU_CHUYEN_PHAT",param);
        }

        public DataTable theoTieuChi_GiaoNhan(string str)
        {
            SqlParameter[] param = new SqlParameter[1];

            param[0] = new SqlParameter("@P_THEO_TIEU_CHI", SqlDbType.NVarChar);
            param[0].Value = str;
            return _conn.ExecuteDataTable("REPORT_THEOTIEUCHI_GIAONHAN", param);
        }

        public DataTable theoTieuChi_ThanhToan(string str)
        {
            SqlParameter[] param = new SqlParameter[1];

            param[0] = new SqlParameter("@P_THEO_TIEU_CHI", SqlDbType.NVarChar);
            param[0].Value = str;
            return _conn.ExecuteDataTable("REPORT_THEOTIEUCHI_THANHTOAN", param);
        }

        public DataTable ThanhPho()
        {

            return _conn.ExecuteSelectQuery("SELECT PARAMETER_NAME FROM PARAMETERS WHERE PARAMETER_CODE = 'city' ORDER BY ORDERING", null);
        }


    }
}
